<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let hd = [1, 2, 3, 4];

      console.log(hd);
      let str = hd.join("-");
      console.log(str);

      console.log(location.href + "?id=" + str);

      let str2 = "hdcms";

      console.log(str2.split(""));

      // 如果对象有length属性，就可以使用Array.from将他转换为对象
      let obj = {
        name: "hdmcs",
        age: "22",
        length: 3,
        sex: "nan",
      };

      console.log(Array.from(obj));

      let arrayLike = {
        0: "tom",
        1: "65",
        2: "男",
        3: ["jane", "john", "Mary"],
        length: 4,
      };
      let arr = Array.from(arrayLike);
      console.log(arr);
    </script>
  </body>
</html>
